package wechat.base.snd;

import org.eclipse.xtend.lib.annotations.Accessors;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.Pure;
import org.json.JSONObject;
import wechat.base.snd.encoding.JsonPut;

@SuppressWarnings("all")
public class QRCode {
  @Accessors
  private String action_name;
  
  @Accessors
  private String scene_str;
  
  @Accessors
  private String scene_id;
  
  @Accessors
  private String ticket;
  
  @Accessors
  private String expire_seconds;
  
  @Accessors
  private String url;
  
  public QRCode(final String scene_id_str) {
    this.scene_str = scene_id_str;
  }
  
  public JSONObject toPermJsonRequst() {
    JsonPut _xblockexpression = null;
    {
      this.action_name = "QR_LIMIT_STR_SCENE";
      JsonPut _jsonPut = new JsonPut();
      final Procedure1<JsonPut> _function = new Procedure1<JsonPut>() {
        public void apply(final JsonPut it) {
          JsonPut _jsonPut = new JsonPut();
          final Procedure1<JsonPut> _function = new Procedure1<JsonPut>() {
            public void apply(final JsonPut it) {
              JsonPut _jsonPut = new JsonPut();
              final Procedure1<JsonPut> _function = new Procedure1<JsonPut>() {
                public void apply(final JsonPut it) {
                  it.putObj("scene_str", QRCode.this.scene_str);
                }
              };
              JsonPut _doubleArrow = ObjectExtensions.<JsonPut>operator_doubleArrow(_jsonPut, _function);
              it.putObj("scene", _doubleArrow);
            }
          };
          JsonPut _doubleArrow = ObjectExtensions.<JsonPut>operator_doubleArrow(_jsonPut, _function);
          it.putObj("action_info", _doubleArrow);
          it.putObj("action_name", QRCode.this.action_name);
        }
      };
      _xblockexpression = ObjectExtensions.<JsonPut>operator_doubleArrow(_jsonPut, _function);
    }
    return _xblockexpression;
  }
  
  public JSONObject toTempJsonRequst() {
    JsonPut _xblockexpression = null;
    {
      this.action_name = "QR_SCENE";
      JsonPut _jsonPut = new JsonPut();
      final Procedure1<JsonPut> _function = new Procedure1<JsonPut>() {
        public void apply(final JsonPut it) {
          it.putObj("expire_seconds", 604800);
          it.putObj("action_name", QRCode.this.action_name);
          JsonPut _jsonPut = new JsonPut();
          final Procedure1<JsonPut> _function = new Procedure1<JsonPut>() {
            public void apply(final JsonPut it) {
              JsonPut _jsonPut = new JsonPut();
              final Procedure1<JsonPut> _function = new Procedure1<JsonPut>() {
                public void apply(final JsonPut it) {
                  it.putObj("scene_id", QRCode.this.scene_id);
                }
              };
              JsonPut _doubleArrow = ObjectExtensions.<JsonPut>operator_doubleArrow(_jsonPut, _function);
              it.putObj("scene", _doubleArrow);
            }
          };
          JsonPut _doubleArrow = ObjectExtensions.<JsonPut>operator_doubleArrow(_jsonPut, _function);
          it.putObj("action_info", _doubleArrow);
        }
      };
      _xblockexpression = ObjectExtensions.<JsonPut>operator_doubleArrow(_jsonPut, _function);
    }
    return _xblockexpression;
  }
  
  @Pure
  public String getAction_name() {
    return this.action_name;
  }
  
  public void setAction_name(final String action_name) {
    this.action_name = action_name;
  }
  
  @Pure
  public String getScene_str() {
    return this.scene_str;
  }
  
  public void setScene_str(final String scene_str) {
    this.scene_str = scene_str;
  }
  
  @Pure
  public String getScene_id() {
    return this.scene_id;
  }
  
  public void setScene_id(final String scene_id) {
    this.scene_id = scene_id;
  }
  
  @Pure
  public String getTicket() {
    return this.ticket;
  }
  
  public void setTicket(final String ticket) {
    this.ticket = ticket;
  }
  
  @Pure
  public String getExpire_seconds() {
    return this.expire_seconds;
  }
  
  public void setExpire_seconds(final String expire_seconds) {
    this.expire_seconds = expire_seconds;
  }
  
  @Pure
  public String getUrl() {
    return this.url;
  }
  
  public void setUrl(final String url) {
    this.url = url;
  }
}
